package com.nenude.corejava.ch9.homework;

import java.util.Scanner;

public class TestNumberBack {

	public static void main(String[] args) {
		// 回文数
		System.out.println("输入一行数：");
		Scanner scanner = new Scanner(System.in);
		String str = scanner.nextLine();
		int a = 0;
		for (int i = 0; i < str.length() / 2; i++) {
			if (str.charAt(i) == str.charAt(str.length() - 1 - i)) {
				a++;
			}
		}
		if (a == (str.length() / 2)) {
			System.out.println("是回文数!");
		} else {
			System.out.println("不是回文数！");
		}

	}// mian
}
